import React, { PropTypes, Component } from 'react'
import { Link } from 'react-router'
import {myAjax, getAuthShop, ROOTURL,ROOTPATH} from './../publicAPI/publicAPI'
import styles from './StatisticsM.css'

class StatisticsM extends Component {

	constructor (props, context) {
	    super(props, context)
	    this.state = {

		}
	    console.log("初始化")
	}

	componentWillMount() {
		var _this = this;
		getAuthShop(null, function(data) {
			console.log(data);
			var shopsForAdm = [];
			data.forEach((shopMes) => {
				shopsForAdm.push(shopMes.dname);
			});
			console.log(shopsForAdm)
		}.bind(_this));
		console.log("将安装")
	}

	componentDidMount() {
	    console.log("安装成功")

	}
	/*handleClick() {
		myAjax('https://api.github.com/users/js', 'POST', {id: 11},function() {alert("ok")}, function() {alert("error")})
		 fetch('https://api.github.com/users/js', {
		     method: 'GET',
		     headers: {
		       "Content-type": "application/x-www-form-urlencoded; charset=UTF-8"
		     },
		 	  body: 'login=KingJch'
		 	})
		 	.then(function( res ) {
		 		if(res.ok) {
		 			alert("ok")
		 		}
		 		else {
		 			alert("error")
		 		}
		 	})
		 	.then(function (data) {
		 	    console.log('Request succeeded with JSON response', data);
		 	})
			.catch(function (error) {
		 	    console.log('Request failed', error);
		 	});
	}*/
    render() {
	    return (
	    	<div>
		    	<div className="right-wapper">
		    		<div className={styles['nav-wrap']}>
						<ul className={styles['ul-nav']}>
							<Link to="/StatisticsM/FootfallTable" activeClassName={styles['li-link-active']}  className={styles['li-link']}>
								<li>各店客流量</li>
							</Link>
							<Link to="/StatisticsM/incomeTable" activeClassName={styles['li-link-active']}  className={styles['li-link']}>
								<li>各店营业额</li>
							</Link>
							<Link to="/StatisticsM/TodayDataTable" activeClassName={styles['li-link-active']}  className={styles['li-link']}>
								<li>经营状况(实时)</li>
							</Link>
							<Link to="/StatisticsM/MonthDataTable" activeClassName={styles['li-link-active']}  className={styles['li-link']}>
								<li>理发店月结算报表</li>
							</Link>
							<Link to="/StatisticsM/SerDayDataTable" activeClassName={styles['li-link-active']}  className={styles['li-link']}>
								<li>理发师当日数据</li>
							</Link>
							<Link to="/StatisticsM/SerMonthDataTable" activeClassName={styles['li-link-active']}  className={styles['li-link']}>
								<li>理发师月结算报表</li>
							</Link>
							<Link to="/StatisticsM/DepositMonSumTable" activeClassName={styles['li-link-active']}  className={styles['li-link']}>
								<li>充值金额(年、月)</li>
							</Link>
							<Link to="/StatisticsM/DepositDailySumTable" activeClassName={styles['li-link-active']}  className={styles['li-link']}>
								<li>充值金额(月、日)</li>
							</Link>
							<Link to="/StatisticsM/SerDayForType" activeClassName={styles['li-link-active']}  className={styles['li-link']}>
								<li>理发师当日数据(按服务类型)</li>
							</Link>
							<Link to="/StatisticsM/SerMonthForType" activeClassName={styles['li-link-active']}  className={styles['li-link']}>
								<li>理发师月结算(按服务类型)</li>
							</Link>
							{/*<Link to="/StatisticsM/AllShopDataTable" activeClassName={style['li-link-active']}  className={style['li-link']}>
								<li>历史总数据</li>
							</Link>
							<li className={styles['li-search']}>
								<input type="text" placeholder="搜索暂未开发" readOnly="true" className={styles['li-input']} />
							</li>*/}

						</ul>
		    		</div>
		    		<div className={styles['nav-wrap']}>
						<ul className={styles['ul-nav']}>
							<Link to="/StatisticsM/SerMonEvaluation" activeClassName={styles['li-link-active']}  className={styles['li-link']}>
								<li>理发师评价指数(当月)</li>
							</Link>
							<Link to="/StatisticsM/SerAllEvaluation" activeClassName={styles['li-link-active']}  className={styles['li-link']}>
								<li>理发师评价指数(汇总)</li>
							</Link>
							<Link to="/StatisticsM/ShopCommission" activeClassName={styles['li-link-active']}  className={styles['li-link']}>
								<li>门店提成结算报表</li>
							</Link>
							<Link to="/StatisticsM/CommissionSum" activeClassName={styles['li-link-active']}  className={styles['li-link']}>
								<li>提成总额</li>
							</Link>
						</ul>
		    		</div>
		    		<div className={styles['rt-wrap']}>
		    		{this.props.children}
		    		</div>
		    	</div>

	    	</div>
	    )
	  }
}

 export default StatisticsM
